/*
 * Copyright (c) 2013-2018 上海汇数数据. All rights reserved.
 * @(#) Auditable.java 2018-08-11 01:55
 */

package cn.jh.common.core.data.domain;

/**
 * Interface for auditable entities. Allows storing and retrieving creation and modification information. The changing
 * instance (typically some user) is to be defined by a generics definition.
 *
 * @param <U> the auditing type. Typically some kind of user.
 * @author Fuchun
 */
public interface Auditable<U> extends Recording {

    /**
     * Returns the user who created this entity.
     *
     * @return the createdBy
     */
    U getCreatedBy();

    /**
     * Sets the user who created this entity.
     *
     * @param createdBy the creating entity to set
     */
    void setCreatedBy(final U createdBy);

    /**
     * Returns the user who modified the entity lastly.
     *
     * @return the lastModifiedBy
     */
    U getUpdatedBy();

    /**
     * Sets the user who modified the entity lastly.
     *
     * @param updatedBy the last modifying entity to set
     */
    void setUpdatedBy(final U updatedBy);
}